﻿<%@ Page Language="C#" MasterPageFile="~/MangerPage.master" AutoEventWireup="true" CodeFile="Manger_UserDetail.aspx.cs" Inherits="Manger_UserDetail" Title="用户详情" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="pagetitle">用户信息</div>
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="User_ID"
                        DataSourceID="SqlDataSource1" DefaultMode="Edit" Height="50px"  CssClass="mytable" EnableViewState="False">
                            <Fields>
                                <asp:BoundField DataField="User_ID" HeaderText="用户名:" ReadOnly="True" SortExpression="User_ID" />
                                <asp:BoundField DataField="User_Name" HeaderText="真实姓名:" SortExpression="User_Name" />
                                <asp:TemplateField HeaderText="角色">
                                    <EditItemTemplate><asp:RadioButtonList ID="RadioButtonList2" runat="server" RepeatDirection="Horizontal"
                                            Width="300px" SelectedValue='<%# Bind("User_Role") %>'>
                                            <asp:ListItem Value="A">普通教师</asp:ListItem>
                                            <asp:ListItem Value="B">专业管理员</asp:ListItem>
                                            <asp:ListItem Value="C">系统管理员</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="性别:" SortExpression="User_Sex">
                                    <EditItemTemplate>
                                        <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"
                                        SelectedValue='<%# Bind("User_Sex") %>'>
                                            <asp:ListItem Value="M">男</asp:ListItem>
                                            <asp:ListItem Value="F">女</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="学校:" SortExpression="User_School">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("User_School") %>' Width="219px"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="User_College" HeaderText="学院:" SortExpression="User_College" />
                                <asp:BoundField DataField="User_Deparment" HeaderText="部门:" SortExpression="User_Deparment" />
                                <asp:BoundField DataField="User_TeacherNo" HeaderText="教工号:" SortExpression="User_TeacherNo" />
                                <asp:TemplateField HeaderText="E-Mail:" SortExpression="User_Email">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("User_Email") %>' Width="213px"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="User_TelMobile" HeaderText="手机:" SortExpression="User_TelMobile" />
                                <asp:BoundField DataField="User_TelHome" HeaderText="住宅电话:" SortExpression="User_TelHome" />
                                <asp:BoundField DataField="User_Province" HeaderText="省份:" SortExpression="User_Province" />
                                <asp:BoundField DataField="User_City" HeaderText="城市:" SortExpression="User_City" />
                                <asp:TemplateField HeaderText="详细地址:" SortExpression="User_Address">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("User_Address") %>' Width="222px"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:ButtonField ButtonType="Button" CommandName="Update" Text="更新" >
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:ButtonField>
                            </Fields>
                            <FieldHeaderStyle CssClass="table_fieldheader" />
    <RowStyle CssClass="table_fielddata" />
                        </asp:DetailsView>
                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Jxzy_Database %>"
            SelectCommand="SELECT [User_ID], [User_Name], [User_Role], [User_School], [User_College], [User_Deparment], [User_TeacherNo], [User_Email], [User_Sex], [User_Province], [User_City], [User_Address], [User_TelHome], [User_TelMobile] FROM [zyk_Users] WHERE ([User_ID] = @User_ID)"   UpdateCommand="UPDATE [zyk_Users] SET [User_Name] = @User_Name, [User_Role] = @User_Role, [User_School] = @User_School, [User_College] = @User_College, [User_Deparment] = @User_Deparment, [User_TeacherNo] = @User_TeacherNo, [User_Email] = @User_Email, [User_Sex] = @User_Sex, [User_Province] = @User_Province, [User_City] = @User_City, [User_Address] = @User_Address, [User_TelHome] = @User_TelHome, [User_TelMobile] = @User_TelMobile WHERE [User_ID] = @User_ID">
            <SelectParameters>
                <asp:QueryStringParameter Name="User_ID" QueryStringField="userid" Type="String" />
            </SelectParameters>
                                      <UpdateParameters>
                                        <asp:Parameter Name="User_Name" Type="String" />
                                        <asp:Parameter Name="User_Role" Type="String" />
                                        <asp:Parameter Name="User_School" Type="String" />
                                        <asp:Parameter Name="User_College" Type="String" />
                                        <asp:Parameter Name="User_Deparment" Type="String" />
                                        <asp:Parameter Name="User_TeacherNo" Type="String" />
                                        <asp:Parameter Name="User_Email" Type="String" />
                                        <asp:Parameter Name="User_Sex" Type="String" />
                                        <asp:Parameter Name="User_Province" Type="String" />
                                        <asp:Parameter Name="User_City" Type="String" />
                                        <asp:Parameter Name="User_Address" Type="String" />
                                        <asp:Parameter Name="User_TelHome" Type="String" />
                                        <asp:Parameter Name="User_TelMobile" Type="String" />
                                        <asp:Parameter Name="User_ID" Type="String" />
                                    </UpdateParameters>
        </asp:SqlDataSource>
    <br />

</asp:Content>

